{% extends "base.html" %}

{% block content %}
<style>
/* Dashboard 自定义样式 */
.dashboard-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.welcome-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.welcome-section h2 {
    color: #2c3e50;
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-section .text-muted {
    color: #6c757d !important;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 功能卡片样式 */
.feature-card {
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-card .card-body {
    padding: 2rem 1.5rem;
    position: relative;
}

.feature-card .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* 图标样式 */
.feature-card i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* 标题样式 */
.feature-card .card-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 描述文字样式 */
.feature-card .card-text {
    color: #5a6c7d;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* 按钮样式优化 */
.feature-card .btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 特定按钮颜色 */
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #85c1e9);
    border: none;
    color: #ffffff;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #f7dc6f);
    border: none;
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #f1948a);
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
    border: none;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem 0;
    }
    
    .welcome-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-section h2 {
        font-size: 1.8rem;
    }
    
    .feature-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .feature-card .card-title {
        font-size: 1.2rem;
    }
    
    .feature-card .card-text {
        font-size: 0.95rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card {
    animation: fadeInUp 0.6s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
</style>

<div class="dashboard-container">
<div class="container">
<div class="row">
    <div class="col-12">
        <div class="welcome-section">
            <h2>欢迎使用校园智能生活助手</h2>
            <p class="text-muted">您好，{{ session.name }}！</p>
        </div>
    </div>
</div>

<div class="row mt-4">
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-calendar-alt fa-3x mb-3"></i>
                <h5 class="card-title">课程表查询</h5>
                <p class="card-text">查看和管理您的课程安排</p>
                <a href="{{ url_for('schedule') }}" class="btn btn-primary">进入</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-search fa-3x mb-3"></i>
                <h5 class="card-title">失物招领</h5>
                <p class="card-text">发布和查找丢失物品</p>
                <a href="{{ url_for('lost_found') }}" class="btn btn-success">进入</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-book fa-3x mb-3"></i>
                <h5 class="card-title">图书馆座位</h5>
                <p class="card-text">预约和管理图书馆座位</p>
                <a href="{{ url_for('library') }}" class="btn btn-info">进入</a>
            </div>
        </div>
    </div>
</div>

<div class="row mt-3">
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-newspaper fa-3x mb-3"></i>
                <h5 class="card-title">新闻公告</h5>
                <p class="card-text">查看校园最新资讯</p>
                <a href="{{ url_for('news') }}" class="btn btn-warning">进入</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-briefcase fa-3x mb-3"></i>
                <h5 class="card-title">勤工中心</h5>
                <p class="card-text">查看校园勤工岗位和投递简历</p>
                <a href="{{ url_for('job_center') }}" class="btn btn-primary">进入</a>
            </div>
        </div>
    </div>
    
    {% if session.is_admin %}
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-cog fa-3x mb-3"></i>
                <h5 class="card-title">系统管理</h5>
                <p class="card-text">管理用户和系统设置</p>
                <a href="{{ url_for('admin') }}" class="btn btn-danger">进入</a>
            </div>
        </div>
    </div>
    {% else %}
    <div class="col-md-4 mb-3">
        <div class="card feature-card h-100">
            <div class="card-body text-center">
                <i class="fas fa-user-circle fa-3x mb-3"></i>
                <h5 class="card-title">个人中心</h5>
                <p class="card-text">查看个人信息和修改密码</p>
                <a href="{{ url_for('profile') }}" class="btn btn-secondary">进入</a>
            </div>
        </div>
    </div>
    {% endif %}
</div>
</div>
</div>

{% endblock %}